<template>
  <div>
     这是父组件传的值：{{toChild}}
  </div>
</template>

<script>
export default {
    props: {
        toChild: {
            type: String,
            required:true
        }
    },
    data(){
        return {
            msg: '我是子组件传过来的值'
        }
    },
    methods:{
        sendMsg() {
            this.$emit('sendMsg',this.msg)
        }
        
    }
}
</script>

<style>

</style>